package org.excilys.training.ebanking.model;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Immutable;

@Entity
@Cache(region = "entity", usage = CacheConcurrencyStrategy.READ_ONLY)
@Immutable
@Table(name = "TYPE_OPERATIONS")
public class TypeOperation {

	private int id;

	private String nomOperation;

	private boolean retraitImmediat;

	private List<Operation> operation;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name = "nom_operation")
	public String getNomOperation() {
		return nomOperation;
	}

	public void setNomOperation(String nomOperation) {
		this.nomOperation = nomOperation;
	}

	@Column(name = "retrait_immediat")
	public boolean isRetraitImmediat() {
		return retraitImmediat;
	}

	public void setRetraitImmediat(boolean retraitImmediat) {
		this.retraitImmediat = retraitImmediat;
	}

	@OneToMany(mappedBy = "typeOperation")
	public List<Operation> getOperation() {
		return operation;
	}

	public void setOperation(List<Operation> operation) {
		this.operation = operation;
	}

}
